package info.webest.media.radio.comparators;

import info.webest.media.radio.classes.Bitrate;

import java.util.Comparator;

public class BitrateComparatorByBitrate implements Comparator<Bitrate> {
	@Override
	public int compare(Bitrate arg0, Bitrate arg1) {
		int res = ((Integer) arg0.getBitrate().length()).compareTo(arg1
				.getBitrate().length());
		if (res != 0)
			return res;
		return arg0.getBitrate().compareTo(arg1.getBitrate());
	}
}
